package com.jimmy.medical.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonBackReference;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

/**
 * 充值记录中包含的服务项目和次数
 * 
 * @author jimmy
 * @since 0.1
 */
@Entity
@Table(name = "recharge_record_service_item")
public class RechargeRecordServiceItem extends AbstractEntity {
	/** 充值*/
	@ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "rechage_record_id")
    @NotFound(action = NotFoundAction.IGNORE)
    private RechargeRecord record;
	/** 服务项目*/
	@ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "service_item_id")
    @NotFound(action = NotFoundAction.IGNORE)
    private ServiceItem item;
	/** 充值次数*/
	@Column(name = "counts")
	private int counts;
	/** 剩余次数*/
	@Column(name = "rest_counts")
	private int restCounts;
	
	public RechargeRecord getRecord() {
		return record;
	}
	public void setRecord(RechargeRecord record) {
		this.record = record;
	}
	public ServiceItem getItem() {
		return item;
	}
	public void setItem(ServiceItem item) {
		this.item = item;
	}
	public int getCounts() {
		return counts;
	}
	public void setCounts(int counts) {
		this.counts = counts;
	}
	public int getRestCounts() {
		return restCounts;
	}
	public void setRestCounts(int restCounts) {
		this.restCounts = restCounts;
	}
}
